package com.finstone.data.spider.eshop.pipeline.weibo;

import com.finstone.data.spider.eshop.pipeline.BasePipeline;
import com.finstone.data.spider.utils.JsonUtils;
import org.springframework.stereotype.Component;
import us.codecraft.webmagic.ResultItems;
import us.codecraft.webmagic.Task;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by Sean on 2016/3/22.
 */
@Component
public class WeiBoPagePipline extends BasePipeline {

    public void process(ResultItems paramResultItems, Task paramTask) {
        List<Map<String, Object>> list = paramResultItems.get("userInfo");
        this.getNamedParameterJdbcTemplate().batchUpdate("insert into user_info (nick_name,usercard) values (:nick_name,:usercard)",
                paramMapper(list));
    }

}